﻿<dialogs:DialogWindow x:Class="Mnk.TBox.Plugins.NUnitRunner.Components.Dialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:Mnk.TBox.Plugins.NUnitRunner.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:dialogs="clr-namespace:Mnk.Library.WpfControls.Dialogs;assembly=Mnk.Library.WPFControls"
                      xmlns:units="clr-namespace:Mnk.Library.WpfControls.Components.Units;assembly=Mnk.Library.WPFControls"
                      xmlns:components="clr-namespace:Mnk.Library.WpfControls.Components;assembly=Mnk.Library.WPFControls"
                      xmlns:tools="clr-namespace:Mnk.Library.WpfControls.Tools;assembly=Mnk.Library.WPFControls"
                      xmlns:components1="clr-namespace:Mnk.TBox.Plugins.NUnitRunner.Components"
                      xmlns:captioned1="clr-namespace:Mnk.Library.WpfControls.Components.Captioned;assembly=Mnk.Library.WPFControls"
                      xmlns:updater="clr-namespace:Mnk.Library.WpfControls.Components.Updater;assembly=Mnk.Library.WPFControls"
                      mc:Ignorable="d" 
             ShowInTaskbar="True" WindowStartupLocation="CenterOwner"
             Width="660" Height="550"
             MinWidth="660" MinHeight="550">
    <Window.Resources>
        <tools:BoolInverterConverter x:Key="BoolInverterConverter"/>
    </Window.Resources>
    <DockPanel>
        <DockPanel DockPanel.Dock="Bottom" Margin="5">
            <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" >
                <Button Content="{loc:Tr Refresh}" Margin="5" Padding="5,2" Width="70" Click="RefreshClick" Name="btnRefresh"/>
                <Button Content="{loc:Tr Cancel}" Margin="5" Padding="5,2" Width="70" IsCancel="True" Click="CancelClick" Name="btnCancel"/>
                <Label/>
            </StackPanel>
            <updater:IntegratedProgress Margin="0" Name="Progress" VerticalAlignment="Stretch"/>
        </DockPanel>
        <TabControl DockPanel.Dock="Top" Name="Tabs">
            <TabItem Header="{loc:Tr ConfigureLibrariesWithUnitTests}" Name="FilePathesTab">
                <DockPanel>
                    <GroupBox Margin="5" Header="{loc:Tr Categories}" VerticalContentAlignment="Stretch" DockPanel.Dock="Bottom">
                        <DockPanel Height="200">
                            <CheckBox Content="{loc:Tr UseCategories}" IsChecked="{Binding UseCategories}" DockPanel.Dock="Top" Margin="5"/>
                            <DockPanel Margin="10 2 2 2" IsEnabled="{Binding UseCategories}">
                                <StackPanel DockPanel.Dock="Top" >
                                    <RadioButton Content="{loc:Tr Include}" IsChecked="{Binding IncludeCategories}" GroupName="Category" Margin="2"/>
                                    <RadioButton Content="{loc:Tr Exclude}" IsChecked="{Binding IncludeCategories, Converter={StaticResource BoolInverterConverter}}" GroupName="Category" Margin="2"/>
                                </StackPanel>
                                <components:CheckableListBox Name="Categories" Margin="2"/>
                            </DockPanel>
                        </DockPanel>
                    </GroupBox>
                    <units:CheckableFileListBoxUnit ItemsSource="{Binding FilePathes}" UnitType="FilePath" PathGetterType="File"  Title="{loc:Tr ConfigureLibrariesWithUnitTests}" PathGetterFilter="{loc:Tr TestLibrariesFileMasks}"/>
                </DockPanel>
            </TabItem>
            <TabItem Header="{loc:Tr Tests}">
                <components1:TestsView x:Name="View"/>
            </TabItem>
            <TabItem Header="{loc:Tr Settings}" Name="SettingsTab">
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <GroupBox Margin="5" Header="{loc:Tr Clonning}" VerticalAlignment="Stretch" Grid.Column="1">
                        <DockPanel >
                            <components:ExtCheckBox Name="CopyToSeparateFolders" IsChecked="{Binding CopyToSeparateFolders}" Content="{loc:Tr CopyToSeparateFolders}"  Margin="5" DockPanel.Dock="Top"/>
                            <captioned1:CaptionedEditPath Caption="{loc:Tr FolderToCloneTests}" Value="{Binding DirToCloneTests}" PathGetterType="Folder" IsEnabled="{Binding ElementName=CopyToSeparateFolders, Path=IsChecked}" Margin="5" DockPanel.Dock="Top" />
                            <Label Content="{loc:Tr FileMasksToCopy}" DockPanel.Dock="Top" Margin="5 0" Padding="0"/>
                            <units:CheckableListBoxUnit ItemsSource="{Binding CopyMasks}" IsEnabled="{Binding ElementName=CopyToSeparateFolders, Path=IsChecked}" Margin="5 0 5 5" UnitType="Text" Title="{loc:Tr FileMasksToCopy}"/>
                        </DockPanel>
                    </GroupBox>
                    <DockPanel Grid.Column="0">
                        <GroupBox Margin="5" Header="{loc:Tr Configuration}" DockPanel.Dock="Top">
                            <StackPanel >
                                <StackPanel DockPanel.Dock="Top" >
                                    <components:ExtCheckBox Content="{loc:Tr RunAsx86}" IsChecked="{Binding RunAsx86}" Margin="5"/>
                                    <components:ExtCheckBox Content="{loc:Tr RunAsAdmin}" IsChecked="{Binding RunAsAdmin}" Margin="5"/>
                                    <StackPanel Orientation="Horizontal">
                                        <captioned1:CaptionedComboBox Caption="{loc:Tr Framework}" Value="{Binding RuntimeFramework}" Margin="5" IsEditable="False" Name="Framework"/>
                                        <captioned1:CaptionedComboBox Caption="{loc:Tr ProcessMode}" Value="{Binding Mode}" Margin="5" IsEditable="False" Name="Mode"/>
                                        <captioned1:CaptionedNumericUpDown Caption="{loc:Tr Timeout}" Value="{Binding Timeout}" Minimum="0" Maximum="3600" Margin="5" />
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </GroupBox>
                        <GroupBox Margin="5" Header="{loc:Tr Multithreading}" DockPanel.Dock="Top">
                            <StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <captioned1:CaptionedNumericUpDown Name="ProcessCount" Caption="{loc:Tr ProcessCount}" Value="{Binding ProcessCount}" Minimum="1" Maximum="16" Margin="5"/>
                                    <captioned1:CaptionedNumericUpDown Name="AssembliesCount" Caption="{loc:Tr AssembliesCount}" Value="{Binding AssembliesCount}" Minimum="1" Maximum="16" Margin="5"/>
                                </StackPanel>
                                <captioned1:CaptionedNumericUpDown Caption="{loc:Tr StartDelay}" Value="{Binding StartDelay}" Minimum="0" Maximum="60" Margin="5" HorizontalAlignment="Left"/>
                                <StackPanel HorizontalAlignment="Stretch">
                                    <captioned1:CaptionedEditPath Caption="{loc:Tr CommandToRunBeforeTests}" Value="{Binding CommandBeforeTestsRun}" PathGetterType="File" Margin="5"/>
                                    <components:ExtCheckBox Content="{loc:Tr SynchronizeTestsAgents}" IsChecked="{Binding NeedSynchronizationForTests}" Margin="5" DockPanel.Dock="Top"/>
                                    <components:ExtCheckBox Content="{loc:Tr UsePrefetch}" IsChecked="{Binding UsePrefetch}" Margin="5"/>
                                </StackPanel>
                            </StackPanel>
                        </GroupBox>
                        <Label/>
                    </DockPanel>
                </Grid>
            </TabItem>
            <TabItem Header="{loc:Tr Statistics}" >
                <components1:TestsStatistics x:Name="Statistics"/>
            </TabItem>
        </TabControl>
    </DockPanel>
</dialogs:DialogWindow>